<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;

class CateController extends Controller
{
    //show
    public function show()
    {
    	//查询出顶级类
    	$pdata = DB::table('cate') -> where('pid','0')-> get()->toArray();
    	//查询出所有数据;
    	$data = DB::table('cate')-> get()->toArray();
        // var_dump("<pre>",$data);die();
    	// dd($data);	
    	return view('home.product.index',['data' => $data,'pdata'=> $pdata]);
    }

    //call
    public function call()
    {
        return view('home.product.call');
    }
}
